Results 1 to 3 of 3

Thread: Footer and header disappeared

Threaded View

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jul 2005
    Posts
    22

    Footer and header disappeared

    Hi,
    I tried to set up bookmarks in Word header in MS word97, then pass values through VBA in Access 97. I save as the word doc, then I send Email and add this word doc as an attachment. However, when I open the attachment, I do not have footer and header, when I do "print preview", it shows up without images in footer and header. I do not know why?
    1, Why I lost images in the header?
    2, Why when I open the attachment in email, footer and header does not show. When I do view>footer and header, footer and header become editable, when close it, it disappear again. I can not view document with footer and header on it. Why???

    Here is the code.
    VB Code:
    1. Set objWord = CreateObject("Word.Application")
    2.         With objWord
    3.             'Make the application visible
    4.             .Visible = True
    5.             'Open the document
    6.            
    7.             .Documents.Open ("I:\PROPS\TEMP\PostProcessor-QAFORM.doc")
    8.            
    9.             .ActiveDocument.Bookmarks("WONumber").Select
    10.             .Selection.Text = rsKey.Fields("WONumber")
    11.            
    12.             'Move to each bookmark and insert text from the form
    13.             .ActiveDocument.Bookmarks("ContactName").Select
    14.             .Selection.Text = (CStr([Forms]![CustomerInfo]![Contact subform].[Form]![FirstName] & " " & [Forms]![CustomerInfo]![Contact subform].[Form]![LastName]))
    15.             .ActiveDocument.SaveAs FileName:="C:\TEMP\PostProcessor-QAFORM.doc", FileFormat:=wdFormatDocument
    16.         End With
    17. objWord.ActiveDocument.Close SaveChanges:=wdDoNotSaveChanges
    18.         'Quit MicrosoftWord97 and release the object variable
    19.         objWord.Quit
    20.         Set objWord = Nothing
    21.  
    22. Public Function Mailer(NameRef As String)
    23.  
    24. Dim olkapps As Outlook.Application
    25. Dim olknamespaces As Outlook.NameSpace
    26. Dim objmailitems As Outlook.MailItem
    27.  
    28. Set olkapps = New Outlook.Application
    29. Set olknamespaces = GetNamespace("MAPI")
    30. Set objmailitems = olkapps.CreateItem(olMailItem)
    31. With objmailitems
    32. .To = NameRef
    33. .subject = "Key File"
    34. .body = ""
    35. .Importance = olImportanceHigh
    36. .Attachments.ADD "c:\temp\LicensePack.txt"
    37. .Attachments.ADD "C:\TEMP\PostProcessor-QAFORM.doc"
    38. .Save
    39.  
    40.  
    41. End With
    42.  
    43. Set objmailitems = Nothing
    44. Set olknamespaces = Nothing
    45. Set olkapps = Nothing
    46.  
    47. End Function





    Edit: Added [vbcode][/vbcode] tags for more clarity. - Hack
    Last edited by Hack; Dec 1st, 2005 at 12:43 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width