question

AnthonyAbner-3888 avatar image
0 Votes"
AnthonyAbner-3888 asked VikiJi-MSFT edited

I am getting 5941 RT Error code...but why?

Here is my VB code:

  Dim artistName As Range
     Set artistName = ActiveDocument.Bookmarks("artistName").Range
     artistName.Text = Me.TextBox1.Value
     Dim artistAddress As Range
     Set artistAddress = ActiveDocument.Bookmarks("artistAddress").Range
     artistAddress.Text = Me.TextBox4.Value
     Dim recordingFund As Range
     Set recordingFund = ActiveDocument.Bookmarks("recordingFund").Range
     recordingFund.Text = Me.TextBox2.Value
     Dim marketingBudget As Range
     Set marketingBudget = ActiveDocument.Bookmarks("marketingBudget").Range
     marketingBudget.Text = Me.TextBox3.Value
     Dim revShare As Range
     Set revShare = ActiveDocument.Bookmarks("revShare").Range
     revShare.Text = Me.TextBox5.Value
     Dim rightsPeriod As Range
     Set rightsPeriod = ActiveDocument.Bookmarks("rightsPeriod").Range
     rightsPeriod.Text = Me.TextBox6.Value
     Dim territory As Range
     Set territory = ActiveDocument.Bookmarks("territory").Range
     territory.Text = Me.TextBox7.Value
     Me.Repaint
     Dim strDocName As String
     Dim intPos As Integer
     
     ' Find position of extension in file name
     strDocName = ""
     intPos = InStrRev(strDocName, ".")
     
     If intPos = 0 Then
     
         ' If the document has not yet been saved
         ' Ask the user to provide a file name
         strDocName = InputBox("Please enter the name " & _
             "of your document.")
     Else
     
         ' Strip off extension and add ".txt" extension
         strDocName = Left(strDocName, intPos - 1)
         strDocName = strDocName & ".docx"
     End If
     
     ' Save file with new extension
     ActiveDocument.SaveAs2 FileName:=strDocName, _
         FileFormat:=wdFormatDocumentDefault
     stInfo.Hide
     infoForm.Show
        
 End Sub
office-vba-dev
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@AnthonyAbner-3888,
Your issue is more related to VBA code, as the tag office-word-itpro focuese on general issues about Word client, I will remove it. Thanks for your understanding.

0 Votes 0 ·

0 Answers