I have a FORM .dotm - works fine on my computer and several others.
when run on another computer I get 'unexpected error 32809' - have no idea why????
Actually shows: Application-defined or Object-defined error - run-time error 32809
the macros on the form are these:
(the funny characters are HEBREW but all works ok)
Private Sub CommandButton11_Click()
With ActiveDocument
.Shapes(1).Visible = msoFalse
.Shapes(2).Visible = msoFalse
End With
Call FileSave
End Sub
Sub FileSave()
If ActiveDocument.Path = "" Then
Call FileSaveAs
Else
ActiveDocument.Save
End If
End Sub
Sub FileSaveAs()
Dim strTag As String
Dim strñåâ As String
Dim strùí_äãéøä As String
Dim strùí_äîá÷ø As String
Dim strúàøéê_áé÷åø As String
Dim strùòú_äáé÷åø As String
Dim strPath As String
Dim strFilename As String
strPath = "\\filesrv\Diur\management\îðäìé úçåîéí\áé÷åøéí áãéøåú\" ' <== change as needed
strTag = "ñåâ"
strñåâ = GetCCcontentbyTag(strTag)
If strñåâ = "**EmptyCC**" Then
MsgNotReady strTag
Exit Sub
ElseIf strñåâ = "**MissingCC**" Then
MsgMissing strTag
Exit Sub
End If
strTag = "ùí_äãéøä"
strùí_äãéøä = GetCCcontentbyTag(strTag)
If strùí_äãéøä = "**EmptyCC**" Then
MsgNotReady strTag
Exit Sub
ElseIf strùí_äãéøä = "**MissingCC**" Then
MsgMissing strTag
Exit Sub
End If
strTag = "ùí_äîá÷ø"
strùí_äîá÷ø = GetCCcontentbyTag(strTag)
If strùí_äîá÷ø = "**EmptyCC**" Then
MsgNotReady strTag
Exit Sub
ElseIf strùí_äîá÷ø = "**MissingCC**" Then
MsgMissing strTag
Exit Sub
End If
strTag = "úàøéê_áé÷åø"
strúàøéê_áé÷åø = GetCCcontentbyTag(strTag)
If strúàøéê_áé÷åø = "**EmptyCC**" Then
MsgNotReady strTag
Exit Sub
ElseIf strúàøéê_áé÷åø = "**MissingCC**" Then
MsgMissing strTag
Exit Sub
End If
strTag = "ùòú_äáé÷åø"
strùòú_äáé÷åø = GetCCcontentbyTag(strTag)
If strùòú_äáé÷åø = "**EmptyCC**" Then
MsgNotReady strTag
Exit Sub
ElseIf strùòú_äáé÷åø = "**MissingCC**" Then
MsgMissing strTag
Exit Sub
End If
strPath = strPath & strñåâ & "\"
ActiveDocument.SaveAs2 FileName:=strPath & strùí_äãéøä & " " & _
strùí_äîá÷ø & " " & strúàøéê_áé÷åø & " " & ".pdf", FileFormat:=wdFormatPDF
Call SendEmail(strPath, strñåâ, strùí_äãéøä, strùí_äîá÷ø, strúàøéê_áé÷åø, strùòú_äáé÷åø)
End Sub
Function GetCCcontentbyTag(theTag As String) As String
Dim CCs As ContentControls
Dim CCcontent As String
Set CCs = ActiveDocument.SelectContentControlsByTag(theTag)
If CCs.Count = 0 Then
' Should not get here if CCs are marked "cannot be deleted"
CCcontent = "**MissingCC**"
Else
If CCs(1).ShowingPlaceholderText Then
CCcontent = "**EmptyCC**"
Else
CCcontent = CCs(1).Range.Text
End If
End If
GetCCcontentbyTag = CCcontent
End Function
Sub MsgNotReady(theTag As String)
Dim strTitle As String
Dim strMsg As String
Select Case theTag
Case "ñåâ"
strTitle = "ñåâ"
Case "ùí_äãéøä"
strTitle = "ùí_äãéøä"
Case "ùí_äîá÷ø"
strTitle = "ùí_äîá÷ø"
Case "úàøéê_áé÷åø"
strTitle = "úàøéê_áé÷åø"
Case "ùòú_äáé÷åø"
strTitle = "ùòú_äáé÷åø"
Case Else
' can't get here except by error
strTitle = "ìà éãåò"
End Select
strMsg = "äúéáä " & strTitle & " öøéëä ëðéñä." & vbCr & _
"àðà îìà àåúå åìðñåú ùåá ëãé ìùîåø."
MsgBox strMsg
End Sub
Sub MsgMissing(theTag As String)
Dim strTitle As String
Dim strMsg As String
Select Case theTag
Case "ñåâ"
strTitle = "ñåâ"
Case "ùí_äãéøä"
strTitle = "ùí_äãéøä"
Case "ùí_äîá÷ø"
strTitle = "ùí_äîá÷ø"
Case "úàøéê_áé÷åø"
strTitle = "úàøéê_áé÷åø"
Case "ùòú_äáé÷åø"
strTitle = "ùòú_äáé÷åø"
Case Else
' can't get here except by error
strTitle = "ìà éãåò"
End Select
strMsg = "äúéáä " & strTitle & " öøéëä ëðéñä." & vbCr & _
"àðà îìà àåúå åìðñåú ùåá ëãé ìùîåø."
MsgBox strMsg
End Sub
Sub SendEmail(strPath As String, strñåâ As String, strùí_äãéøä As String, strùí_äîá÷ø As String, strúàøéê_áé÷åø As String, strùòú_äáé÷åø As String)
'Send Email to Offer that file has been created
strFilename = strPath & strùí_äãéøä & " " & _
strùí_äîá÷ø & " " & strúàøéê_áé÷åø
Dim OutApp As Object
Dim OutMail As Object
Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)
With OutMail
.To = "*** Email address is removed for privacy ***"
.BCC = "*** Email address is removed for privacy ***"
.Subject = "ãåç áé÷åø ùì ãéøä " & strùí_äãéøä
.Body = strFilename
.Send
End With
Set OutMail = Nothing
Set OutApp = Nothing
' Close active document
Application.Quit SaveChanges:=wdDoNotSaveChanges
End Sub
Private Sub CommandButton111_Click()
End Sub