+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Spammer
    Join Date
    02-26-2009
    Location
    U.S
    MS-Off Ver
    Access
    Posts
    73

    MS Word Doc file creation

    Hi experts,

    I am developing a project in which i hav used MSWORD.OLB class to create a document file in VC++. But there are a lot of function in this class collection. If any body have worked on this class and knows how to create a new DOC file and how a text can be added in new created file, Reply soon....


    Thanks in advance.

    I'm a bit of a newbie and I've tried to record a macro to do this but it puts everything into the first footer.

    I have searched through these forums and come up with a macro that lets me place text into the first page only - but I can't then add the alternative footer for subsequent pages.

    Here's my macro (apologies in advance....)


    Sub footer()
    '
    ' footer Macro
    '
    '

    ActiveDocument.PageSetup.DifferentFirstPageHeaderFooter = True
    WordBasic.ViewFooterOnly
    Selection.Font.Size = 8
    Selection.ParagraphFormat.Alignment = wdAlignParagraphRight
    Selection.TypeText Text:= _
    "MY WEBSITE ADDRESS AND COMPANY DETAILS"
    If ActiveWindow.View.SplitSpecial = wdPaneNone Then
    ActiveWindow.ActivePane.View.Type = wdPrintView
    Else
    ActiveWindow.View.Type = wdPrintView
    WordBasic.ViewFooterOnly
    Selection.InlineShapes.AddPicture FileName:= _
    "C:\images\mylogo.jpg", _
    LinkToFile:=False, SaveWithDocument:=True
    End If

    End Sub

  2. #2
    Forum Moderator shg's Avatar
    Join Date
    06-21-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2007
    Posts
    25,134

    Re: MS Word Doc file creation

    Please edit your post to add code tags.
    Microsoft MVP - Excel
    Entia non sunt multiplicanda sine necessitate

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.2.0