How to change to Webview from VBA

R

Ronny Sigo

Hello all,
I have made a VBA routine wich takes the username, date and so on and
inserts it in a new Word document which is opened and ready for typing. Its
purpose is to be sent as an email, displaying a logo as background. In
order to be able to see the background this document must be in the Webview
state. I was not able to do this with something like:
ActiveWindow.View.Type = wdWebView
Can anybody give me the correct syntax to do this as well as the place where
to put it?
Here is the code:

Private Sub btnEmailknop_Click()

Dim appWD As Object
Dim myDoc As Object
Dim nHowmuchdown As Integer
Dim iLijn As Integer
Set appWD = CreateObject("Word.Application")
appWD.Visible = True

With appWD
.Resize Width:=768, Height:=552
Set myDoc = .Documents.Add
.ActiveDocument.Background.Fill.Visible = msoTrue
.ActiveDocument.Background.Fill.ForeColor.RGB = RGB(0, 255, 255)
.ActiveDocument.Background.Fill.Transparency = 0#
.ActiveDocument.Background.Fill.UserPicture _
"K:\1. Management\1.7. ICT\1.7.3.
Applicaties\Taken\Beelden\logo_ZW_cbv.jpg"
.WindowState = wdWindowStateMaximize
With .Selection
.ParagraphFormat.LeftIndent = 0
.PageSetup.LeftMargin = 80
.PageSetup.RightMargin = 52
.PageSetup.TopMargin = 127
.ParagraphFormat.LineSpacing = 13
.Font.Name = "Arial"
.Font.Size = 10

.insertafter Text:="Verzenddatum: " & vbTab & Date &
vbCr
.insertafter Text:="Tijdstip: " & vbTab & Time &
vbCr
.insertafter Text:="Afzender: " & vbTab &
sNaamschrijver & vbCr
.insertafter Text:=" " & vbTab & "Culturele
Biografie Vlaanderen vzw"

End With
.Activate

'.WindowState = wdWindowStateMaximize

myDoc.ActiveWindow.ActivePane.VerticalPercentScrolled = 10
End With
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top